home *** CD-ROM | disk | FTP | other *** search
- //▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- //
- // * Llamada a la función 00h de la BIOS VESA.
- // * Watcom C/C++ v.11
- //
- //▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ (c) Pedro Díez López ▓▓▓▓▓▓
-
- #include <i86.h>
- //#include <stdio.h>
-
- typedef struct
- {
- unsigned char Firma [4]; // VESA
- unsigned int VersionVESA; // Version de la BIOS VESA.
- char __far *InfoFabricante; // Información del fabricante.
- unsigned char Hardware [4]; // Posibilidades del hardware.
- int __far *Modos; // Modos disponibles.
- unsigned int Memoria; // Numero de bloques de 64Kb.
- unsigned int VersionSoftware; // Version del software.
- char __far *InfoVendedor; // Informacion del vendedor.
- char __far *InfoProducto; // Informacion del producto.
- unsigned char Reservados [222];
- unsigned char Informacion [256];
- } TInfoVESA;
-
- TInfoVESA *InfoVESA;
-
-
- void main (void)
- {
- union REGS regs;
- struct SREGS segr;
- int Cnt;
-
- regs.w.ax=0x0003; // Pon modo texto con la BIOS VESA:
- int86 (0x10,®s,®s); // Funcion 00h (AH) Modo 03h (AL)
-
- InfoVESA=(TInfoVESA *) malloc (512);
- strncpy(InfoVESA->Firma,"VBE2",4); // Escribe VBE2 en el campo Firma,
- // para recibir 512 bytes de información.
- segr.es =FP_SEG(InfoVESA);
- regs.w.di =FP_OFF(InfoVESA);
- regs.w.ax =0x4F00;
- int86 (0x10,®s,®s);
-
- if (regs.h.al!=0x4F) printf ("El registro de estado ha devuelto %xh, por lo tanto no hay BIOS VESA\n",regs.h.al);
- else
- {
- printf ("La función 00h de la BIOS VESA ha devuelto:\n");
- printf (" Firma .....................: ");
- for (Cnt=0;Cnt<4;Cnt++) printf ("%c",InfoVESA->Firma[Cnt]);
- printf ("\n Version VESA ..............: %u.%u\n",InfoVESA->VersionVESA>>8,InfoVESA->VersionVESA&0xFF);
- printf (" Informacion del fabricante : ");
- printf ("%s\n",InfoVESA->InfoFabricante);
- printf (" Informacion del hardware ..: ");
- if ( InfoVESA->Hardware[0]&1==0) printf ("DAC de 6 bits de RGB\n");
- else printf ("DAC de mas de 6 bits de RGB\n");
- if ((InfoVESA->Hardware[0]>>1)&1==0) printf (" Hardware 100%% compatible VGA\n");
- else printf (" El hardware no es 100%% compatible VGA\n");
- if ((InfoVESA->Hardware[0]>>2)&1==1) printf (" RAMDAC clasico\n");
- printf (" Modos disponibles .........: ");
- Cnt=0;
- while (InfoVESA->Modos[Cnt]!=0xFFFF)
- {
- printf ("%xh ",InfoVESA->Modos[Cnt]);
- Cnt++;
- };
- printf ("\n");
- printf (" Memoria de video ..........: %u Kb\n",64*InfoVESA->Memoria);
- printf (" Version del software ......: %u.%u\n",InfoVESA->VersionSoftware>>8,InfoVESA->VersionSoftware&0xFF);
- printf (" Informacion del Vendedor ..: ");
- printf ("%s\n",InfoVESA->InfoVendedor);
- printf (" Informacion del Producto ..: ");
- printf ("%s\n",InfoVESA->InfoProducto);
- }
- free (InfoVESA);
- };